<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <script src="__STATIC__/js/jquery.js"></script>
    <script src="__STATIC__/layui/layui.js"></script>
    <script type="text/javascript" src="__STATIC__/x-admin/js/xadmin.js"></script>
    <link rel="stylesheet" href="__STATIC__/x-admin/css/font.css">
    <link rel="stylesheet" href="__STATIC__/x-admin/css/xadmin.css">
    <link rel="stylesheet" href="__STATIC__/layui/css/layui.css">
    <title>教案修改</title>
    <style>
        ul li select,
        select option {
            direction: rtl;
        }
    </style>
</head>
<body>
<div style="width: 500px;margin: 0 auto">
    <form class="layui-form" action="" onsubmit="return false" id="plan">
        <input type="hidden" name="edit" value="1">
        <input type="hidden" name="primaryMotion" value="{$info.motion}">
        <input type="hidden" value="{$info.id}" name="id">
        <input type="hidden" name="one_img" value="{$oneImg}">
        <input type="hidden" name="two_img" value="{$twoImg}">
        <input type="hidden" name="three_img" value="{$imgStr}">
        <div class="layui-form-item">
            <label class="layui-form-label">运动项目</label>
            <div class="layui-input-block">
                <input type="text" name="motion" value="{$info.motion}" id="motion"  placeholder="运动项目" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">运动类别</label>
            <div class="layui-input-block">
                <select name="project_id" >
                    {foreach $project as $value}
                        <option value="{$value.id}" {if $info.project_id == $value.id} selected {/if}>{$value.title}</option>
                    {/foreach}
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">教案章节</label>
            <div class="layui-input-block">
                <select name="plan_type_id" >
                    {foreach $type as $val}
                        <option value="{$val.id}" {if $val['id'] == $info['plan_type_id']}selected{/if}>
                            {if $val['level'] == 1}
                                {$val.title}
                            {else/}
                                <?php
                                    for($i=1;$i<$val['level'];$i++){
                                        echo "&nbsp;&nbsp;";
                                    }
                                ?>
                                |-{$val.title}
                            {/if}

                        </option>
                    {/foreach}
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">适合班级</label>
            <div class="layui-input-block">
                <?php $gradeId = explode(',',trim($info['grade_id'],','));?>
                {foreach $grade as $value}
                    <input type="checkbox" {if in_array($value.id,$gradeId)} checked {/if} name="class_id[]" value="{$value.id}" title="{$value.grade_title}">
                {/foreach}
            </div>
        </div>
        <!-- <div class="layui-form-item layui-form-text">
            <label class="layui-form-label">教材分析</label>
            <div class="layui-input-block">
                <textarea name="textbook_analysis"  required id="textbook_analysis" placeholder="教材分析" class="layui-textarea">{$info.textbook_analysis|htmlspecialchars_decode}</textarea>
            </div>
        </div>
        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label">教法与学法</label>
            <div class="layui-input-block">
                <textarea name="teaching" required id="teaching"  placeholder="教法与学法" class="layui-textarea">{$info.teaching|htmlspecialchars_decode}</textarea>
            </div>
        </div> -->
        <!--<div class="layui-form-item layui-form-text">-->
            <!--<label class="layui-form-label">教学目的</label>-->
            <!--<div class="layui-input-block">-->
                <!--<textarea name="objective" required id="objective" lay-verify="required" placeholder="教学目的" class="layui-textarea">{$info.objective|htmlspecialchars_decode}</textarea>-->
            <!--</div>-->
        <!--</div>-->
        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label">教学内容</label>
            <div class="layui-input-block">
                <textarea name="contents"  id="contents"  placeholder="教学内容" class="layui-textarea">{$info.contents|htmlspecialchars_decode}</textarea>
            </div>
        </div>
        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label">场地器材</label>
            <div class="layui-input-block">
                <textarea name="equipment"  id="equipment"  placeholder="场地器材" class="layui-textarea">{$info.equipment|htmlspecialchars_decode}</textarea>
            </div>
        </div>
        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label">教学目标</label>
            <div class="layui-input-block">
                <textarea name="target"  id="target"  placeholder="教学目标" class="layui-textarea">{$info.target|htmlspecialchars_decode}</textarea>
            </div>
        </div>
        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label">负荷目标</label>
            <div class="layui-input-block">
                <textarea name="load_target"  id="load_target" placeholder="符合目标" class="layui-textarea">{$info.load_target|htmlspecialchars_decode}</textarea>
            </div>
        </div>
        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label">教学重点</label>
            <div class="layui-input-block">
                <textarea name="teaching_emphasis"  id="teaching_emphasis" placeholder="教学重点" class="layui-textarea">{$info.teaching_emphasis|htmlspecialchars_decode}</textarea>
            </div>
        </div>
        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label">教学难点</label>
            <div class="layui-input-block">
                <textarea name="difficulty" placeholder="教学难点" id="difficulty" class="layui-textarea">{$info.difficulty|htmlspecialchars_decode}</textarea>
            </div>
        </div>
<br/>
<span style="font-size: 30px;float: left">开始部分
    <span title="添加" class="layui-icon layui-icon-add-circle" id="add_start" style="font-size: 30px;color: green"></span>&nbsp;&nbsp;&nbsp;&nbsp;
</span><input style="width: 150px" type="text" name="one_count_minute" value="{$info.one_count_minute}" placeholder="总分钟" autocomplete="off" class="layui-input">
        <div id="start">
            <div id="start_info">
                {foreach $info.start_part as $key=> $value}
                <div id="start_child_div{$key}">
                    <span title="删除" class="layui-icon layui-icon-delete" onclick="del_start_div({$key})" style="font-size: 30px;color: red"></span>
                    <div class="layui-form-item layui-form-text">
                        <label class="layui-form-label">教学名称</label>
                        <div class="layui-input-block">
                            <textarea name="one_title[]"  id="one_title" placeholder="教学内容" class="layui-textarea">{$value.one_title|htmlspecialchars_decode}</textarea>
                        </div>
                    </div>
                    <div class="layui-form-item layui-form-text">
                        <label class="layui-form-label">教学内容</label>
                        <div class="layui-input-block">
                            <textarea name="one_contents[]" id="one_contents" placeholder="教学内容" class="layui-textarea">{$value.one_contents|htmlspecialchars_decode}</textarea>
                        </div>
                    </div>
                    <div class="layui-form-item layui-form-text">
                        <label class="layui-form-label">教师活动</label>
                        <div class="layui-input-block">
                            <textarea name="one_activity[]" id="one_activity" placeholder="教师活动" class="layui-textarea">{$value.one_activity|htmlspecialchars_decode}</textarea>
                        </div>
                    </div>
                    <div class="layui-form-item layui-form-text">
                        <label class="layui-form-label">学生活动</label>
                        <div class="layui-input-block">
                            <textarea name="one_s_activity[]" id="one_s_activity"  placeholder="学生活动" class="layui-textarea">{$value.one_s_activity|htmlspecialchars_decode}</textarea>
                        </div>
                    </div>
                    {if strlen($value.one_img)>5}
                        <div class="layui-form-item layui-form-text">
                            <label class="layui-form-label">组织形式</label>
                            <div class="layui-input-block">
                                <img src="http://www.tijian.com/plan/img/{$value.one_img}" width="100px" height="100px">
                            </div>
                        </div>
                    {/if}
                    <div class="layui-form-item layui-form-text">
                        <label class="layui-form-label">新组织形式</label>
                        <div class="layui-input-block">
                            <button type="button" class="layui-btn" id="one_img{$key+1}">
                                <i class="layui-icon layui-icon-upload"></i>上传图片
                            </button>
                        </div>
                        <div class="layui-input-block" id="one_upload_img{$key+1}" style="display: none">
                            <img src="" width="100px" height="100px" id="one_up_img{$key+1}">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">教学视频</label>
                        <div class="layui-input-block">
                            <input type="text" name="one_video[]" value="{$value.one_video}"  placeholder="教学视频" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                </div>
                {/foreach}
            </div>
        </div>

<br/>
<span style="font-size: 30px;color: #0000FF;float: left">准备部分
    <span title="添加" class="layui-icon layui-icon-add-circle" id="add_ready" style="font-size: 30px;color: green"></span>&nbsp;&nbsp;&nbsp;&nbsp;
</span><input style="width: 150px" type="text" name="two_count_minute" value="{$info.two_count_minute}"  placeholder="总分钟" autocomplete="off" class="layui-input">
<br/>
        <div id="ready">
            <div id="ready_info">
                {foreach $info.preparation_part as $key=>$value}
                <div id="ready_child_div{$key}">
                    <span title="删除" class="layui-icon layui-icon-delete" onclick="del_ready_div({$key})" style="font-size: 30px;color: red"></span>
                    <div class="layui-form-item layui-form-text">
                        <label class="layui-form-label">教学名称</label>
                        <div class="layui-input-block">
                            <textarea name="two_title[]"  id="two_title" placeholder="教学内容" class="layui-textarea">{$value.two_title|htmlspecialchars_decode}</textarea>
                        </div>
                    </div>
                    <div class="layui-form-item layui-form-text">
                        <label class="layui-form-label">教学内容</label>
                        <div class="layui-input-block">
                            <textarea name="two_contents[]"  id="two_contents"  placeholder="教学内容" class="layui-textarea">{$value.two_contents|htmlspecialchars_decode}</textarea>
                        </div>
                    </div>
                    <div class="layui-form-item layui-form-text">
                        <label class="layui-form-label">教师活动</label>
                        <div class="layui-input-block">
                            <textarea name="two_activity[]"  id="two_activity"  placeholder="教师活动" class="layui-textarea">{$value.two_activity|htmlspecialchars_decode}</textarea>
                        </div>
                    </div>
                    <div class="layui-form-item layui-form-text">
                        <label class="layui-form-label">学生活动</label>
                        <div class="layui-input-block">
                            <textarea name="two_s_activity[]"  id="two_s_activity" placeholder="学生活动" class="layui-textarea">{$value.two_s_activity|htmlspecialchars_decode}</textarea>
                        </div>
                    </div>
                    {if strlen($value.two_img)>5}
                    <div class="layui-form-item layui-form-text">
                        <label class="layui-form-label">组织形式</label>
                        <div class="layui-input-block">
                            <img src="http://www.tijian.com/plan/img/{$value.two_img}" width="100px" height="100px">
                        </div>
                    </div>
                    {/if}
                    <div class="layui-form-item layui-form-text">
                        <label class="layui-form-label">新组织形式</label>
                        <div class="layui-input-block">
                            <button type="button" class="layui-btn" id="two_img{$key+1}">
                                <i class="layui-icon layui-icon-upload"></i>上传图片
                            </button>
                        </div>
                        <div class="layui-input-block" id="two_upload_img{$key+1}" style="display: none">
                            <img src="" width="100px" height="100px" id="two_up_img{$key+1}">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">教学视频</label>
                        <div class="layui-input-block">
                            <input type="text" name="two_video[]"  value="{$value.two_video}"  placeholder="教学视频" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                </div>
                {/foreach}
            </div>
        </div>

        <br/>
<span style="font-size: 30px;color: #007DDB;float: left">基本部分
    <span title="添加" class="layui-icon layui-icon-add-circle" id="add" style="font-size: 30px;color: green"></span>&nbsp;&nbsp;&nbsp;&nbsp;
</span><input style="width: 150px" type="text" name="three_count_minute" value="{$info.three_count_minute}" placeholder="总分钟" autocomplete="off" class="layui-input">
        <div id="top">
            <div id="info">
                {foreach $info.basic_part as $key=>$value}
                    <div id="div_child{$key}">
                        <span title="删除" class="layui-icon layui-icon-delete" onclick="del_div({$key})" style="font-size: 30px;color: red"></span>
                        <div class="layui-form-item layui-form-text">
                            <label class="layui-form-label">教学名称</label>
                            <div class="layui-input-block">
                                <textarea name="three_title[]" id="three_title"  placeholder="教学名称" class="layui-textarea">{$value.three_title|htmlspecialchars_decode}</textarea>
                            </div>
                        </div>
                        <div class="layui-form-item layui-form-text">
                            <label class="layui-form-label">教学内容</label>
                            <div class="layui-input-block">
                                <textarea name="three_contents[]" id="three_contents"  placeholder="教学内容" class="layui-textarea">{$value.three_contents|htmlspecialchars_decode}</textarea>
                            </div>
                        </div>
                        <div class="layui-form-item layui-form-text">
                            <label class="layui-form-label">教师活动</label>
                            <div class="layui-input-block">
                                <textarea name="three_activity[]" id="three_activity"  placeholder="教师活动" class="layui-textarea">{$value.three_activity|htmlspecialchars_decode}</textarea>
                            </div>
                        </div>
                        <div class="layui-form-item layui-form-text">
                            <label class="layui-form-label">学生活动</label>
                            <div class="layui-input-block">
                                <textarea name="three_s_activity[]" id="three_s_activity"  placeholder="学生活动" class="layui-textarea">{$value.three_s_activity|htmlspecialchars_decode}</textarea>
                            </div>
                        </div>
                        {if strlen($value.three_img) > 5}
                            <div class="layui-form-item layui-form-text">
                                <label class="layui-form-label">组织形式</label>
                                <div class="layui-input-block">
                                    <img src="http://www.tijian.com/plan/img/{$value.three_img}" width="100px" height="100px">
                                </div>
                            </div>
                        {/if}
                        <div class="layui-form-item layui-form-text">
                            <label class="layui-form-label">新组织形式</label>
                            <div class="layui-input-block">
                                <button type="button" class="layui-btn" id="three_img{$key+1}">
                                    <i class="layui-icon layui-icon-upload"></i>上传图片
                                </button>
                            </div>
                            <div class="layui-input-block" id="three_upload_img{$key+1}" style="display: none">
                                <img src="" width="100px" height="100px" id="three_up_img{$key+1}">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">教学视频</label>
                            <div class="layui-input-block">
                                <input type="text" name="three_video[]" value="{$value.three_video}" placeholder="教学视频" autocomplete="off" class="layui-input">
                            </div>
                        </div>
                    </div>
                {/foreach}
            </div>
        </div>
        <br/>
<span style="font-size: 30px;color: red;float: left">结束部分</span>
        &nbsp;&nbsp;&nbsp;&nbsp;<input style="width: 150px" value="{$info.end_count_minute}" type="text" name="end_count_minute"  placeholder="总分钟" autocomplete="off" class="layui-input">
        <br/>
        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label">教学内容</label>
            <div class="layui-input-block">
                <textarea name="four_contents"  id="four_contents"  placeholder="教学内容" class="layui-textarea">{$info.end_part.four_contents|htmlspecialchars_decode}</textarea>
            </div>
        </div>
        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label">教师活动</label>
            <div class="layui-input-block">
                <textarea name="four_activity"  id="four_activity"  placeholder="教师活动" class="layui-textarea">{$info.end_part.four_activity|htmlspecialchars_decode}</textarea>
            </div>
        </div>
        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label">学生活动</label>
            <div class="layui-input-block">
                <textarea name="four_s_activity"  id="four_s_activity"  placeholder="学生活动" class="layui-textarea">{$info.end_part.four_s_activity|htmlspecialchars_decode}</textarea>
            </div>
        </div>
        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label">安全措施</label>
            <div class="layui-input-block">
                <textarea name="security"  id="security"  placeholder="安全措施" class="layui-textarea">{$info.security|htmlspecialchars_decode|htmlspecialchars_decode}</textarea>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn" id="update" >立即修改</button>
                <button onclick="window.history.back(-1);"  class="layui-btn layui-btn-primary">返回</button>
            </div>
        </div>
    </form>
</div>
</body>
<script src="__STATIC__/js/plan/teaching_plan_edit.js"></script>
<script>
    $("#update").click(function(){
        $.ajax({
            url:"{:url('/plan/update')}",
            data:$("#plan").serialize(),
            type:"post",
            dataType:"json",
            success:function(res){
                if(res.code){
                    layer.msg(res.msg,{icon:1,time:2000},function(){
                        window.location.reload();
                    });
                    return;
                }else{
                    layer.msg(res.msg,{icon:5,time:2000});
                    return;
                }
            }
        });
    });
</script>
</html>